/*
 * All rights Reserved, Designed By cloudland Copyright(C) 2010-2014
 *
 * fileName:  SessionListener.java
 * author:  lei
 * Company:  Cloudland Studio
 * Createdate:  2013-9-14 下午8:04:09
 *   
 * Modification  History:
 *     Date           Author        Version        
 * -------------------------------------------
 * 2013-9-14          Lei            1.0        
 *
 * Why & What is modified:
 * 1.0: 文件创建
 */
package org.cloudland.web.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.apache.log4j.Logger;

 /**
 * <pre> 
 * 会话生命周期监听器
 * </pre>
 * @ClassName  SessionListener
 * @author  lei
 * @version  %I%, %G%
 * @see  
 * @since   JDK1.6
 *
 */
public class SessionLifecycleListener implements HttpSessionListener {

	/**
     * LOGGER 日志对象
     */
    private static final Logger LOGGER = Logger.getLogger(SessionLifecycleListener.class);
	
	/**
	 * 创建会话时，调用方法。
	 * @param e
	 */
	public void sessionCreated(HttpSessionEvent e) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Session has been created, the number is " + e.getSession().getId());
		}
		
		
	}
	
	/**
	 * 销毁会话时，调用方法。
	 * @param e
	 */
	public void sessionDestroyed(HttpSessionEvent e) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Sessions had been destroyed, the number is " + e.getSession().getId());
		}
		
		
	}
}
